set hive.exec.dynamic.partition=true;            --  动态分区
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.max.dynamic.partitions=90;         --  每天生成 60 个分区
set hive.exec.max.dynamic.partitions.pernode=90; --  每天生成 60 个分区

insert overwrite table jms_dim.dim_lmdm_sys_customer
select
id
,code
,name
,abbreviation
,industry_id
,type_id
,country_id
,country_code
,province_id
,city_id
,area_id
,address
,is_enable
,is_delete
,create_by
,update_by
,create_by_name
,update_by_name
,create_time
,update_time
,version
,sort
,nature_id
,main_deposit
,contact_name
,contact_mobile
,contact_email
,financial_name
,financial_mobile
,financial_email
,zip_code
,id_card_number
,unified_credit_code
,organization_code
,tax_registration_code
,business_registration_code
,business_license_img_url
,organization_img_url
,tax_registration_img_url
,id_card_front_img_url
,id_card_back_img_url
,network_id
,staff_id
,staff_mobile
,customer_level_id
,is_vip_account
,credit_amount
,is_open_cod
,single_cod_limit
,rebate_period_id
,cc_stt_bank_name
,cc_stt_bank_account
,cc_stt_bank_account_name
,bill_id
,bill_emial
,settlement_id
,customer_share_id
,pay_id
,prompt
,invoice_id
,taxpayer_name
,taxpayer_number
,taxpayer_registration_address
,taxpayer_phone
,taxpayer_bank_name
,taxpayer_bank_account
,invoice_recipient_name
,invoice_recipient_phone
,invoice_recipient_email
,invoice_recipient_address
,source_id
,mall_id
,mall_name
,parent_customer
,meter_bubble
,parent_id
,billing_day
,account_period_id
,quote_id
,ess_object
,billing_weight
,is_max_weight
,is_business_parcel
,share_enable
,printer_equipment_number
,printer_equipment_manufacturer
,printer_applet_qr_img_path
,card_type
,attribute_id
,recalc_cost_flag
,is_receipt_flag
,cast(receipt_fee as decimal(7,2)) as receipt_fee
,settle_customer_code
,market_staff_code
,category_primary_id
,category_primary_name
,category_first_id
,category_first_name
,category_second_id
,category_second_name
,deductions_mode
,is_show_app
,project_name
,ENTITY_CODE
,ENTITY_NAME
from jms_ods.yl_lmdm_sys_customer where dt= '{{ execution_date | cst_ds }}'
 distribute by 1 ;